<?php 
$batch_html="";
$isMasterUser = PFactory::isMasterUser();
$searchUrl = OCP\Util::linkToRoute('resumes_search');
list($folderSearch, $selected) = PResumesHelper::getSearchItemHref($searchUrl, 'dir', $_['fromdir']);

if(PCompanyHelper::isJobAdmin() && !empty($_['showbatchupload'])){
   $batch_html ='<a style="margin-left:35px;line-height:22px;margin-top:4px" class="ppp_bluebtn" id="batchimportbtn" href='.OC_Helper::linkToRoute('resume_showaddform').'>手动创建</a>
                 <a style="margin-left:10px;line-height:22px;margin-top:4px" class="ppp_bluebtn importresumesdbtn" id="batchimportbtn" data-endid="_local" href='.OC_Helper::linkToRoute('resume_showimportdialog').'>本地上传</a>
                 <a style="margin-left:10px;line-height:22px;margin-top:4px" class="ppp_bluebtn importresumesdbtn" id="batchimportbtn" data-endid="_offsite" href='.OC_Helper::linkToRoute('resume_showimportdialog').'>第三方导入</a>';
}
?>
<div class="hr_inner_navigate clearfix">
   <ul>
      <li class="<?php echo $_['fromdir'] == "all" ? "cur_li" : ""; ?>">
         <a href="<?php echo OC_Helper::linkToRoute('resumes_folder');?>"><?=($isMasterUser ? '全部简历' : '我的简历')?></a>
      </li>
      <li class="<?php echo $_['fromdir'] == "saved" ? "cur_li" : ""; ?>">
         <a href="<?php echo OC_Helper::linkToRoute('resumes_folder', array('dir' => 'saved'));?>">我的收藏</a>
      </li>
      <?php 
      $moreselected = true;
      $moreFolderName = '';
      switch ($_['fromdir']) {
         case 'all':
         case 'saved':
            $moreselected = false;
            break;
         case 'shared':
            $moreFolderName = '收到的分享';
            break;
         case 'trashed':
            $moreFolderName = '回收站';
            break;
         default:
            if (is_numeric($_['fromdir'])) {
               $dirInfo = PResumesHelper::getDirInfo($_['fromdir']);
               if (empty($dirInfo)) {
                  $foldername = JRequest::getString('foldername', null);
                  $moreFolderName = $foldername ? $foldername : '';
               } else {
                  $moreFolderName = $dirInfo['foldername'];
               }
            }
            break;
      }
      ?>
      <li class="dropdown <?php echo $moreselected ? "cur_li" : "";?>" id="more_folder">
         <a href="javascript:;" data-href="<?=$folderSearch.'&foldername='.JFilterOutput::stringURLUnicodeSlug($moreFolderName)?>" id="selectmore_folder" class="dropdown-toggle" data-target="#"><b><?=(empty($moreFolderName) ? '文件夹' : strmaxtextlen($moreFolderName, 8))?></b> <i class="blue_triangle"></i></a>
         <div id="folder_dropdown" class="folder_option dropdown-menu popup" data-searchurl="<?=$folderSearch?>"></div>
      </li>
   </ul>
   <div class="hr_breadcrumbs">
   <?php echo isset($_['breadcrumb'])?$_['breadcrumb'].$batch_html:"";?>
   </div>
</div>

<div id="creater_newfolder" class="modal fade hide creater_newfolder">
   <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
      <h3>创建文件夹</h3>
   </div>
   <div class="modal-body">
      <form id="newfolderform" action="<?=OC_Helper::linkTo('resumes','ajax/savefolder.php')?>" method="POST" autocomplete="off">
      <div class="form-horizontal newfolder_body">
         <div class="control-group">
            <label class="control-label">文件夹名称：</label>
            <div class="controls">
               <input name="fname" class="fname" type="text" placeholder="10个中文字符以内">
            </div>
         </div>
         <div class="control-group" style="margin-top:20px;">
            <div class="controls">
               <span class='error server'></span>
               <input class="ppp_bluebtn submit" type="submit" value="确认"/>
            </div>
         </div>
      </div>
      </form>
   </div>
</div>
